<include file="Public:header" />
<script type="text/javascript" charset="UTF-8" src="__PUBLIC__/Partner/js/editor/kindeditor-min.js"></script>
<script type="text/javascript">
    window.KindEditor.options.uploadJson = "{:U('Pic/upload_json')}";
    window.KindEditor.options.fileManagerJson = "{:U('Pic/file_manager_json')}";
</script>

<div class="headbar">
    <div class="position"><span>商品</span><span>></span><span>品牌管理</span><span>></span><span><if condition="$brand.id neq null">编辑<else/>添加</if>品牌</span></div>
</div>
<div class="content_box">
    <div class="content form_content">
        <form action="{:U('Goods/brand_save')}" method="post" enctype='multipart/form-data'>
            <table class="form_table" cellpadding="0" cellspacing="0">
                <col width="150px" />
                <col />
                <tr>
                    <th>品牌名称：</th>
                    <td><input class="normal" name="name" type="text" value="{$brand['name']}" pattern="required" alt="品牌名称不能为空" />
                        <label>*</label>
                        <input name="brand_id" value="{$brand['id']}" type="hidden" />
                    </td>
                </tr>
                <tr>
                    <th>排序：</th><td><input class="normal" name="sort" type="text" value="{$brand['sort']}" pattern='int' empty alt='必需为整形数值'/></td>
                </tr>
                <tr>
                    <th>网址：</th><td><input class="normal" name="url" type="text" value="{$brand['url']}" pattern='url' empty alt='网址格式不正确，比如：http://www.jumark.cn' /><label>完整的URL链接地址，如：http://www.jumark.cn</label></td>
                </tr>
                <tr>
                    <th>LOGO：</th><td><div><if condition="$brand.logo neq null"><img src="__ROOT__/{$brand['logo']}" height="60px"/><br /></if><input type='file' class='normal' name='logo'/></div></td>
                </tr>
                <tr>
                    <th>所属分类：</th>
                    <td>
                        <if condition="$brand_category">
                        <ul class="select">
                            <foreach name='brand_category' item='item' key='key'>
                            <li><label><input type="checkbox" value="{$item['id']}" name="category[]" <if condition="($brand neq null) and  (stripos(','.$brand['category_ids'].',',','.$item['id'].',') !== false)">checked="checked"</if> />{$item['name']}</label></li>
                            </foreach>
                        </ul>
                        <else/>
                        系统暂无品牌分类，<a href="{:U('Goods/brand_category')}" class='orange'>请点击添加</a>
                        </if>
                    </td>
                </tr>
                <tr>
                    <th valign="top">描述：</th><td><textarea name="description" id="description" style="width:700px;height:400px;">{$brand['description']}</textarea></td>
                </tr>
                <tr>
                    <td></td><td><button class="submit" type="submit"><span>确 定</span></button></td>
                </tr>
            </table>
        </form>
    </div>
</div>

<script type="text/javascript">
    $(function()
    {
        //编辑器载入
        KindEditor.ready(function(K){
            K.create('#description');
        });
    })
</script>
<include file="Public:footer" />